export const state = () => ({
  counter: 1
})

export const mutations = {
  ADD_COUNTER(state, text) {
    state.counter += 1
  }
}

export const actions = {
  nuxtServerInit() {
    console.log('%c1启动' + 'store=>index=>actions=>nuxtServerInit', 'color:green')
  },
  add_counter({ commit }) {
    commit('ADD_COUNTER')
  }
}

export const getters = {
  counter: state => state.counter
}
